package zsrt.com.service;

import java.util.Scanner;
import zsrt.com.dao.ExamineeBusinessDao;
import zsrt.com.dao.ExamineeDao;
import zsrt.com.dao.impl.ExamineeBusinessDaoImpl;
import zsrt.com.dao.impl.ExamineeDaoImpl;
import zsrt.com.validate.Validate;

public class SvrExaminee {
	/**
	 * 业务类初始化
	 */
	private ExamineeBusinessDao dao = new ExamineeBusinessDaoImpl();
	
	/**
	 * 初始化扫描仪
	 */
	private Scanner scanner = new Scanner(System.in);
	
	/**
	 * 初始化考生对象，需要用到的时候再new
	 */
	private ExamineeDao examinee;
	
	/**
	 * 查看个人信息包括分数
	 */
	public void examineeFindMessage(){
		dao.examineeFindMessage();
	}
	
	/**
	 * 修改个人信息（分数、准考证号码不能修改）
	 */
	public void examineeUpdateMessage(){
		examinee = new ExamineeDaoImpl();
		examinee.setId(Validate.userId);
		System.err.println("输入你要修改的密码...");
		examinee.setPassword(scanner.next());
		dao.examineeUpdateMessage(examinee);
	}
	
	/**
	 * 查询本市(登录用户所在的城市)的总分状元
	 */
	public void examineeTotalScore(){
		dao.examineeTotalScore();
	}
	
	/**
	 * 查询指定城市的状元
	 */
	public void examineeTotalCity(){
		System.err.println("输入你要查询的城市...");
		String city = scanner.next();
		dao.examineeTotalCity(city);
	}
	
	/**
	 * 查询各个省份500-600分的总人数并由高到低排列显示
	 */
	public void examineeCitySort(){
		dao.examineeCitySort();
	}
	
	/**
	 * 查询各个省份过600分的总人数并由低到高排列显示
	 */
	public void examineeCityOrderBy(){
		dao.examineeCityOrderBy();
	}
	
	/**
	 * 查询全国各个省份的状元
	 */
	public void examineeEveryCityScholar(){
		dao.examineeEveryCityScholar();
	}
}
